<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        // 面向对象 = 构造函数 【基本特性: name , age , sex】+ 原型【方法->共享: 打架 跳舞 唱歌等】

        // 人: 
        function People(name , address , age , sex){
            // 实例属性
            this.name = name
            this.age = age
            this.sex = sex
            this.address = address
        }
            // 实例方法
        People.prototype.sing = function(){
            console.log("歌声优美")
        }
        People.prototype.doEat = function(){
            console.log("厨房天花板")
        }

        var ky = new People("凯玉" , "山东" , 18 , "女")
        var js = new People("金硕" , "石家庄" , 18 , "男")

        console.log( ky.name , js.name )
        ky.doEat()
        js.doEat()
    </script>
</body>
</html>